home *** CD-ROM | disk | FTP | other *** search
- Ada Portable Simple Math Library
-
- Michael B. Feldman
- Department of Electrical Engineering and Computer Science
- The George Washington University
- Washington, DC 20052
- (202) 994-5253 (voice)
- (202) 994-5296 (fax)
- mfeldman@seas.gwu.edu (Internet)
-
- This is a moderately simplified version of the Ada packages for primitive
- and transcendental math functions developed by the Numerics Rapporteur
- Group of the International Standards Organization (ISO) Working Group
- on Ada. The packages in this form were written by Vincent Broman in 1990;
- see the comments in the source files for copyright and distribution
- conditions.
-
- In plain English, you may use, modify, and redistribute these packages
- as long as you continue to redistribute the source code and do not
- put any additional restrictions on distribution.
-
- I simplified Broman's packages to make them compatible with all Ada
- compilers including NYU Ada/Ed. The latter compiler does not support
- double-precision floating point. The Broman packages are generic;
- these packages remove the genericity and are specific to the predefined
- type Float. This simplication is intended to make the math library easy
- to compile and use in educational situations where no use is made of
- programmer-defined numeric types.
-
- I am distributing these packages primarily for educational purposes,
- and make no claims that they are industrial-strength or suitable for use
- in any other environment or for any other purposes.
-
- Studying the source code for these packages reveals the complexities
- of writing portable numerics libraries.
-
- Compile the files in the following order:
-
- constant.ads -- a good collection of standard math constants
- -- which can be with-ed by programs needing
- -- definitions of Pi, e, and so forth
-
- exceptio.ads -- a package exporting Argument_Error. This
- -- package should not need to be with-ed, as
- -- the exception is re-exported by other
- -- packages
-
- primfunc.ads -- a collection of primitive math functions
- -- for retrieving the exponent and mantissa
- -- of floating-point values, truncation, etc.
- -- These may not be very efficient, because
- -- they do not depend on the availability
- -- of underlying representation information.
- -- This package should not normally be with-ed
- -- unless its functions are needed by the client.
-
- primfunc.adb -- Body of the primitive functions package.
-
- math.ads -- This is the actual math functions package,
- -- and will be the one normally with-ed by clients.
- -- It contains all the usual transcendental
- -- functions, square root, trig functions, etc.
-
- math.adb -- Body of the math library.
-
- Once these files are compiled, clients should include the context clause
- WITH Math to gain access to the math functions. To get the constants,
- use the context clause WITH Math_Constants.
-
- NOTE: The bodies for Primitive_Functions and Math are LONG. Expect
- them to take a while to compile, especially using Ada/Ed. Be patient -
- you only have to compile them once!
-